<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <link rel="icon" href="${blog_favicon!'${una}/img/favicon.png'}" type="image/x-icon">
    <link rel="shortcut icon" href="${blog_favicon!'${una}/img/favicon.png'}" type="image/x-icon">
    <link rel="stylesheet" href="${una}/css/bootstrap.css" />
    <link rel="stylesheet" href="${una}/js/layer/theme/default/layer.css"/>
    <link rel="stylesheet" href="${una}/css/font-awesome.css" />
    <link rel="stylesheet" href="${una}/css/ionicons.css" />
    <link rel="stylesheet" href="${una}/css/blog-boot.css" />
    <title>仪表盘 - 尤娜(UnaBoot)</title>
    <style>
        ul.data-list{
            padding-left:5px;
        }
        ul.data-list li{
            list-style: none;
            padding: 5px 0px;
        }
        ul.data-list li a{
            display: inline-block;
            width: 248px;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
            color: #007bff;
        }
        .talk{
            height: 360px;
            overflow-y: auto;
            padding-right: 5px;
        }
        .talk li{
            border-bottom: 1px solid #ddd;
            padding: 10px;
        }
        .talk li:hover{
            background: rgba(0,0,0,.1);
        }
    </style>
</head>
<body>
<div class="header fixed-top">
    <div class="container">
        <div class="left">
            <a href="${una}/admin/dashboard" class="logo"><img src="${blog_logo!'${una}/img/logo.png'}" class="img-fluid" style="height: 40px"></a>
        </div>
        <div class="middle">
            <div class="inner">
                <a href="${una}/admin/dashboard" class="current"><i class="fa fa-dashboard"></i> 主页</a>
                <a href="${una}/admin/posts" ><i class="fa fa-edit"></i> 创作</a>
                <a href="${una}/admin/categories"><i class="fa fa-th-large"></i> 页面</a>
                <a href="${una}/admin/themes" ><i class="fa fa-gift"></i> 主题</a>
                <a href="${una}/admin/settings/general"><i class="fa fa-sliders"></i> 系统</a>
            </div>
        </div>
        <div class="right">
            <a href="/admin/logout" data-toggle="tooltip" data-placement="bottom" title="退出"><i class="fa fa-sign-out"></i></a>
            <a href="javascript:void(0);" id="profile" data-toggle="tooltip" data-placement="bottom" title="个人设置"><i class="fa fa-cogs"></i></a>
            <a href="${una}/index.html" data-toggle="tooltip" data-placement="bottom" title="博客主页"><i class="fa fa-home"></i></a>
        </div>
    </div>
</div>
<div class="wrapper">
    <div class="container">
        <div class="row">
            <div class="col-12">
                <h5 style="font-weight: bold;text-shadow: 0px -5px 5px #d2d6de;">仪表板</h5>
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title" style="font-weight: bold;">欢迎使用Una-Boot博客管理系统!</h3>
                        <p class="mb-0 mt-1">下列是一些常用的功能链接</p>
                    </div>
                    <div class="box-body">
                        <div class="row">
                            <div class="col-4">
                                <h5 class="mb-4">配置</h5>
                                <a href="/admin/settings/general" class="btn btn-primary" style="padding: 10px 35px;">自定义网站</a>
                                <h6 class="mt-2">或者,<a href="/admin/themes" style="color: #007bff">改变网站主题</a></h6>
                            </div>
                            <div class="col-4">
                                <h5 class="mb-4">创作</h5>
                                <h6 class="mt-2"><i class="fa fa-edit"></i> <a href="/admin/posts/write" style="color: #007bff">开始创作新的文章</a></h6>
                                <h6 class="mt-3"><i class="fa fa-plus"></i> <a href="/admin/categories" style="color: #007bff">添加新页面</a></h6>
                                <h6 class="mt-3"><i class="fa fa-upload"></i> <a href="/admin/themes/install" style="color: #007bff">上传新主题</a></h6>
                                <h6 class="mt-3"><i class="fa fa-link"></i> <a href="/admin/links" style="color: #007bff">添加一个友情链接</a></h6>
                            </div>
                            <div class="col-4">
                                <h5 class="mb-4">其他</h5>
                                <h6 class="mt-2"><i class="fa fa-cube"></i> <a href="/admin/settings/cdn" style="color: #007bff">CDN设置</a></h6>
                                <h6 class="mt-3"><i class="fa fa-database"></i> <a href="/admin/settings/druid" style="color: #007bff">数据源监控</a></h6>
                                <h6 class="mt-3"><i class="fa fa-graduation-cap"></i> <a href="javascript:void(0);" style="color: #007bff">了解更多详细信息</a></h6>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-4">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">最近发表</h3>
                    </div>
                    <div class="box-body">
                        <ul class="data-list">
                            <@una_newest size=10>
                                <#if results?? && results?size gt 0>
                                    <#list results as post>
                                        <li>
                                            <a href="${una}/post/${post.slug}" target="_blank" title="${post.title}">${post.title}</a>
                                            <span class="pull-right text-muted"><i class="fa fa-calendar-minus-o"></i> ${una_timeAgo(post.createTime)}</span>
                                        </li>
                                    </#list>
                                </#if>
                            </@una_newest>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-4">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">热门内容</h3>
                    </div>
                    <div class="box-body">
                        <ul class="data-list ">
                            <@una_hottest size=10>
                                <#if results?? && results?size gt 0>
                                    <#list results as post>
                                        <li>
                                            <a href="${una}/post/${post.slug}" target="_blank" title="${post.title}">${post.title}</a>
                                            <span class="pull-right text-muted pr-1"><i class="fa fa-eye"></i> ${una_numFormat(post.visits)}</span>
                                        </li>
                                    </#list>
                                </#if>
                            </@una_hottest>
                        </ul>
                    </div>
                </div>
            </div>
            <div class="col-4">
                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">最新评论</h3>
                    </div>
                    <div class="box-body">
                        <ul class="data-list talk">
                            <@una_newest_talk>
                                <#if results?? && results?size gt 0>
                                    <#list results as talk>
                                        <li>
                                            <span class="text-muted mb-1">${talk.body}</span><br>
                                            <span class="text-primary pr-1">
                                                <a href="${talk.htmlUrl}" target="_blank">
                                                    <img src="${talk.avatarUrl}" class="img-fluid" style="width: 20px;border-radius: 50%">&nbsp;${talk.login}
                                                </a>
                                            </span>
                                            <span class="text-muted pull-right"><i class="fa fa-calendar-minus-o"></i>${una_timeAgo(talk.createAt)}</span>
                                        </li>
                                    </#list>
                                </#if>
                            </@una_newest_talk>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">

        </div>
    </div>
</div>
<div class="footer">

</div>
</body>

<script type="text/javascript" src="${una}/js/jquery.min.js" ></script>
<script type="text/javascript" src="${una}/js/layer/layer.js"></script>
<script type="text/javascript" src="${una}/js/bootstrap.min.js" ></script>
<script type="text/javascript" src="${una}/js/bootstrap.bundle.js" ></script>
<script type="text/javascript" src="${una}/js/echarts.min.js" ></script>
<script type="text/javascript" src="${una}/js/blog-boot.js"></script>
<script>
    $(function(){
        $("#profile").on("click",function(){
            layer.open({
                type:2,
                title:"<i class='fa fa-users'> 重置管理员密码</i>",
                shadeClose:false,
                shade:0.5,
                area:['400px','350px'],
                offset:['150px'],
                content:"${una}/admin/user/profile",
                resize:false,
                anim:2,
            });
        });
    });
</script>
</html>
